﻿using UnityEngine;
using System.Collections;

///Developed By Indie Studio
///https://assetstore.unity.com/publishers/9268
///www.indiestd.com
///info@indiestd.com

namespace IndieStudio.BugsBang.Utility
{
	[DisallowMultipleComponent]
	public class Rotate : MonoBehaviour {

		/// <summary>
		/// Whether rotation is enabled or not.
		/// </summary>
		public bool Enabled =  true; 

		/// <summary>
		/// The speed of rotation.
		/// </summary>
		public float speed = 10;

		/// <summary>
		/// The rotate direction.
		/// </summary>
		private Vector3 direction = new Vector3 (0, 0, 1);

		// Use this for initialization
		void Start () {
		
		}
		
		// Update is called once per frame
		void Update () {
			if (Enabled) {
				transform.Rotate (direction * speed * Time.smoothDeltaTime);
			}
		}

	}
}